int is_sort_arr(int* arr, int sz)
{
	int s = 0;
	int j = 0;

	int  ret = 0;

	int prev = 0;
	int next = 1;
	while (next < sz)
	{
		if (arr[prev] < arr[next])
			s++;
		if (arr[prev] > arr[next])
			j++;

		prev++;
		next++;
	}
	// printf("s = %d j = %d \n", s, j);

	if (s == sz - 1) //升序		
		return 1;
	else if (j == sz - 1) // 降序
		ret = -1;
	else // 无序
		ret = 0;

	return ret;
}

int main() {
	int arr[] = { 0};
	// printf("%p\n",arr);
	int sz = sizeof(arr) / sizeof(arr[0]);
	int ret = is_sort_arr(arr, sz);
	// printf("%d \n", ret);

	if (ret == 1)
		printf("升序数组\n");
	else if (ret == -1)
		printf("降序数组\n");
	else
		printf("无序数组\n");
}